package vg.modules.attribute_panel.components.data;

import java.util.ArrayList;
import java.util.List;

public class AttributeValue implements Comparable<AttributeValue> {
	private final List<String>data;
	/**
	 * Constructor
	 */
	public AttributeValue() {
		this.data = new ArrayList<String>();
	}
	/**
	 * This method adds value to array. All values of array sorted in lexicographical order.
	 */
	public synchronized boolean addValue(String value) {
		if(!this.data.contains(value)) {
			String currValue;
			for(int i = 0; i < this.data.size(); i++) {
				currValue = this.data.get(i);
				if(currValue.compareTo(value) > 0) {
					this.data.add(i, value);
					return(true);
				}
			}
			return(this.data.add(value));
		}
		return(true);
	}
	public List<String> getData() {
		return(this.data);
	}
	///////////////////////////////////////////////////////////////////////////
	// IMPLEMENTATION OF COMPARABLE
	///////////////////////////////////////////////////////////////////////////
	public int compareTo(AttributeValue o) {
		return 0;
	}
}
